package com.supermap.IMOCTimerTask;

import java.util.Timer;

public class ReportToIMOCTimerTaskManager {
    private Timer timer = new Timer("Timer-ReportToIMOCTimerTask");
    private long delay;
    private long period;

    private ReportToIMOCTimerTask task;

    public void setDelay(long delay) {
        this.delay = delay;
    }

    public void setPeriod(long period) {
        this.period = period;
    }

    public void setTask(ReportToIMOCTimerTask task) {
        this.task = task;
    }

    public void start() {
        timer.schedule(task, delay, period);
    }

    public void stop() {
        timer.cancel();
    }
}
